package com.zhihaihe.file.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhihaihe.file.pojo.UserFileBean;
import com.zhihaihe.file.vo.file.FileListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserFileMapper extends BaseMapper<UserFileBean> {
    /**
     * 替换用户文件路径
     * @param filePath
     * @param oldFilePath
     * @param userId
     */
    void replaceFilePath(@Param("filePath") String filePath, @Param("oldFilePath") String oldFilePath, @Param("userId") Long userId);

    /**
     * 查询文件列表
     * @param userFile
     * @param beginCount
     * @param pageCount
     * @return
     */
    List<FileListVo> userFileList(@Param("userFile")UserFileBean userFile, @Param("beginCount") Long beginCount, @Param("pageCount")Long pageCount);

    /**
     * 根据用户id查看存储大小
     * @param userId
     * @return
     */
    Long selectStorageSizeByUserId(Long userId);

    /**
     * 查询文件不再扩展名中
     * @param arrList
     * @param beginCount
     * @param pageCount
     * @param userId
     * @return
     */
    List<FileListVo> selectFileNotInExtendNames(@Param("fileNameList")List<String> arrList
            , @Param("beginCount")long beginCount,@Param("pageCount") long pageCount, @Param("userId")long userId);

    /**
     * 查询文件不再扩展名中 计数
     * @param fileNameList
     * @param beginCount
     * @param pageCount
     * @param userId
     * @return
     */
    Long selectCountNotInExtendNames(List<String> fileNameList, Long beginCount, long pageCount, long userId);

    List<FileListVo> selectFileByExtendName(List<String> fileNameList, Long beginCount, long pageCount, long userId);

    Long selectCountByExtendName(List<String> fileNameList, Long beginCount, long pageCount, long userId);
}
